const http = require('http');
const cluster = require('cluster');
const os = require('os');
const process = require('process');

if(cluster.isMaster){
  for(let i=0;i<os.cpus().length;i++){
    cluster.fork();
  }
}else{
    console.log(process.pid);
    http.createServer((req,res)=>{
      res.write('aaaa');
      res.end();
    }).listen(8080);
    console.log('服务器准备好了8080');
}
